package com.example.transport.message;

import java.io.Serializable;
import java.util.UUID;


/***
 *
 * 请求体
 */
public class Request implements Serializable {
    public static final String PUBLISH = "publish";
    public static final String SUBSCRIBE = "subscribe";

    private String id = UUID.randomUUID().toString();
    private Object data;
    private String flag;
    private String topic;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public Request(String flag, String topic, Object data) {
        this.data = data;
        this.flag = flag;
        this.topic = topic;
    }

    @Override
    public String toString() {
        return "Request{" +
                "id='" + id + '\'' +
                ", data=" + data +
                ", flag='" + flag + '\'' +
                ", topic='" + topic + '\'' +
                '}';
    }
}
